using System.ComponentModel.DataAnnotations;

namespace TerritoryGame.Application.Dtos;

/// <summary>
/// 修改密码DTO
/// </summary>
public class ChangePasswordDto
{
    private string _oldPassword = string.Empty;
    private string _newPassword = string.Empty;
    private string _confirmPassword = string.Empty;

    [Required(ErrorMessage = "旧密码不能为空")]
    public string OldPassword
    {
        get => _oldPassword;
        set => _oldPassword = (value ?? string.Empty).Trim();
    }

    [Required(ErrorMessage = "新密码不能为空")]
    [StringLength(100, MinimumLength = 6, ErrorMessage = "新密码长度必须在6-100个字符之间")]
    public string NewPassword
    {
        get => _newPassword;
        set => _newPassword = (value ?? string.Empty).Trim();
    }

    [Required(ErrorMessage = "确认密码不能为空")]
    public string ConfirmPassword
    {
        get => _confirmPassword;
        set => _confirmPassword = (value ?? string.Empty).Trim();
    }
}